﻿using System;
using System.Collections.Generic;
using UnityEngine;

public class InputManager : MonoSingleton<InputManager>
{
    private PlayerEntity player;


    public override void Initialize()
    {
        base.Initialize();
    }

    public override void Release()
    {
        base.Release();
    }

    public void SetPlayer(PlayerEntity player)
    {
        this.player = player;
    }

    public void Update()
    {
        if(player == null) return;
        if (Input.GetKey(KeyCode.D))
        {
            player.Move(MoveDir.Right);
        }
        else if (Input.GetKey(KeyCode.A))
        {
            player.Move(MoveDir.Left);
        }
        else if (Input.GetKey(KeyCode.S))
        {
            player.Move(MoveDir.Down);
        }
        else if (Input.GetKey(KeyCode.W))
        {
            player.Move(MoveDir.Up);
        }

    }
}
